package com.darren.archive.service.impl;

import com.darren.archive.dao.SysRoleFunctionDao;
import com.darren.archive.entity.SysRole;
import com.darren.archive.entity.SysRoleFunction;
import com.darren.archive.repository.SysRoleFunctionRepository;
import com.darren.archive.service.SysRoleFunctionService;
import com.darren.framework.service.impl.GenericServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * <pre>
 * *********************************************
 * Copyright DARREN
 * All rights reserved.
 * Description: TODO(description)
 * HISTORY:
 * *********************************************
 *  Version		Date		Author	   		Desc
 *   v1.0       2019-12-07  Darren Zhou    Create
 *
 * *********************************************
 * </pre>
 */

@Service
@Transactional(rollbackFor = Exception.class)//默认该类的所有方法都开启事务，遇到Exception就回滚
public class SysRoleFunctionServiceImpl extends GenericServiceImpl<SysRoleFunction, Long> implements SysRoleFunctionService {

    @Resource
    private SysRoleFunctionDao sysRoleFunctionDao;

    @Autowired
    private SysRoleFunctionRepository sysRoleFunctionRepository;


    @Override
    public void deleteRoleFunctionByRoleId(Long roleId) {
        sysRoleFunctionRepository.deleteByRoleId(roleId);
    }

    @Override
    public List<Long> getFunctionIdsByRoleId(Long roleId, Integer checkedStatus) {
        return null;
    }

    @Override
    public Integer batchSaveRoleFunction(Long roleId, List<Long> functionIds, Integer checkedStatus) {
        return null;
    }
}
